<?php
declare (strict_types = 1);

namespace app\api\dao;

use app\api\model\Cate;
use think\facade\Db;
//商品
class GoodsDao
{
    public $goodsListModel;
    public $goodsDetail;


    //商品列表
    public  function list(): array
    {
        $this->goodsListModel= DB::table("zl_survey_product")
            ->field("product_code,name,price,y_price,tags,require")
            ->where("status",10)
            ->order("sort","desc")
            ->paginate()->toArray();
        return $this->goodsListModel;
    }

    //商品列表
    public  function detail($product_code)
    {
        $this->goodsDetail= DB::table("zl_survey_product")
            ->where("product_code",$product_code)
            ->where("status",10)
            ->find();
        return $this->goodsDetail;
    }



}
